package fengma.service.impl;

import fengma.service.ComputeClient;
import fengma.service.ComputeHystrixClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by liys on 2017/9/12.
 */
@RestController
public class ConsumerController {
    @Autowired
    ComputeClient computeClient;
    @Autowired
    ComputeHystrixClient computeHystrixClient;
    @RequestMapping(value = "/add", method = RequestMethod.GET)
    public Integer add() {
        return computeClient.add(10, 20);
    }

    @RequestMapping(value = "/addhystrix",method = RequestMethod.GET)
    public Integer addhystrix(){
        return computeHystrixClient.addhystrix(20,30);
    }

}
